<template>
  <div class="common-layout">
    <el-container>

      <el-container>
        <el-aside width="200px" class="aside-menu beautify-aside">
          <el-scrollbar>
             <el-menu
                default-active="0"
                class="el-menu-vertical-demo"
                @open="handleOpen"
                @close="handleClose"
                router
            >
                <el-sub-menu index="1">
                <template #title>
                    <el-icon><Folder /></el-icon>
                    <span>供应商管理</span>
                </template>
                <el-menu-item-group>
                    <el-menu-item index="suppliers">
                        <el-icon><Menu /></el-icon>
                        供应商列表
                    </el-menu-item>
                    <el-menu-item index="supplierscount">
                        <el-icon><Histogram /></el-icon>
                        供应商数量统计
                    </el-menu-item>
                    <el-menu-item index="supplierstype">
                        <el-icon><Setting /></el-icon>
                        供应商设置
                    </el-menu-item>
                </el-menu-item-group>
                </el-sub-menu>
                <el-sub-menu index="2">
                <template #title>
                    <el-icon><Folder /></el-icon>
                    <span>采购申请</span>
                </template>
                <el-menu-item-group>
                    <el-menu-item index="2-1">
                        <el-icon><EditPen /></el-icon>
                        新增采购申请
                    </el-menu-item>
                    <el-menu-item index="2-2">
                        <el-icon><Menu /></el-icon>
                        采购申请列表
                    </el-menu-item>
                    <el-menu-item index="2-2">
                        <el-icon><Menu /></el-icon>
                        采购申请明细列表
                    </el-menu-item>
                    
                </el-menu-item-group>
                </el-sub-menu>
                <el-sub-menu index="3">
                <template #title>
                    <el-icon><Folder /></el-icon>
                    <span>到货质检</span>
                </template>
                <el-menu-item-group>
                    <el-menu-item index="3-1">
                        <el-icon><EditPen /></el-icon>
                        新增到货质检申请
                    </el-menu-item>
                    <el-menu-item index="3-2">
                        <el-icon><Menu /></el-icon>
                        质检申请列表
                    </el-menu-item>
                </el-menu-item-group>
                </el-sub-menu>
                <el-sub-menu index="4">
                <template #title>
                    <el-icon><Folder /></el-icon>
                    <span>采购退货</span>
                </template>
                <el-menu-item-group>
                    <el-menu-item index="4-1">
                        <el-icon><EditPen /></el-icon>
                        新增采购退货
                    </el-menu-item>
                    <el-menu-item index="4-2">
                        <el-icon><Menu /></el-icon>
                        采购退货列表
                    </el-menu-item>
                </el-menu-item-group>
                </el-sub-menu>
            </el-menu>
          </el-scrollbar>
        </el-aside>
        <el-main class="aside-main-bg">
        <RouterView/>
        </el-main>
      </el-container>
    </el-container>
  </div>

</template>
<script setup lang="ts">


import {
  Setting,
} from '@element-plus/icons-vue'

const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}

</script>

<style scoped>
.common-layout {
  height: 100vh;
  background: #f5f7fa;
}
.aside-header {
  background: transparent;
  box-shadow: none;
  padding: 0;
  height: auto;
}
.beautify-user-panel {
  display: flex;
  align-items: center;
  padding: 22px 0 18px 18px;
  background:#409eff;
  border-radius: 10px;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.03);
  margin: 12px 10px 0 10px;
}
.user-avatar {
  width: 54px !important;
  height: 54px !important;
  min-width: 54px;
  min-height: 54px;
  box-shadow: 0 2px 8px 0 rgba(64,158,255,0.15);
}
.user-meta {
  margin-left: 2000px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  
}
.user-name {
  
  font-weight: 700;
  color: #222;
  font-size: 17px;
  margin-bottom: 2px;
}
.user-dept, .user-role {
  font-size: 13px;
  color: #fff;
  font-weight: 400;
  margin-bottom: 1px;
}
.beautify-aside {
  background: #fff;
  box-shadow: 2px 0 8px 0 rgba(0,0,0,0.04);
  border-right: 1px solid #e4e7ed;
  padding: 0;
  min-height: 100vh;
}
.aside-main-bg {
  background: #f5f7fa;
  min-height: 100vh;
  padding: 0;
}
.divider {
  margin: 10px 0 10px 0;
  border-color: #f0f0f0;
}
.divider-gap {
  margin: 18px 0 10px 0;
}
.el-menu-vertical-demo.beautify-menu {
  background: transparent;
  border-right: none;
  font-size: 15px;
  padding-bottom: 20px;
}
.el-menu-vertical-demo.beautify-menu .el-menu-item {
  border-radius: 8px;
  margin: 2px 8px;
  padding-left: 18px !important;
  transition: background 0.2s, color 0.2s;
  height: 42px;
  line-height: 42px;
  font-size: 15px;
  display: flex;
  align-items: center;
}
.el-menu-vertical-demo.beautify-menu .el-menu-item .el-icon {
  margin-right: 10px;
  font-size: 18px;
}
.el-menu-vertical-demo.beautify-menu .el-menu-item.is-active {
  background: linear-gradient(90deg, #e6f0fe 80%, #fff 100%) !important;
  color: #409eff !important;
  font-weight: 600;
  position: relative;
}
.el-menu-vertical-demo.beautify-menu .el-menu-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 4px;
  height: 28px;
  background: #409eff;
  border-radius: 3px;
}
.el-menu-vertical-demo.beautify-menu .el-menu-item:hover {
  background: #f2f8ff !important;
  color: #409eff;
}
.el-menu-vertical-demo.beautify-menu .el-sub-menu__title {
  font-weight: 500;
  color: #333;
  padding-left: 10px !important;
  height: 40px;
  line-height: 40px;
  border-radius: 8px;
  margin: 2px 8px;
  transition: background 0.2s, color 0.2s;
}
.el-menu-vertical-demo.beautify-menu .el-sub-menu__title .el-icon {
  margin-right: 10px;
  font-size: 18px;
}
.el-menu-vertical-demo.beautify-menu .el-sub-menu__title:hover {
  background: #f2f8ff !important;
  color: #409eff;
}
.el-menu-vertical-demo.beautify-menu .el-menu--inline {
  background: transparent !important;
}
.el-menu-vertical-demo.beautify-menu .el-menu--inline .el-menu-item {
  padding-left: 36px !important;
  font-size: 14px;
}
.el-menu-vertical-demo.beautify-menu .el-menu--inline .el-menu--inline .el-menu-item {
  padding-left: 54px !important;
  font-size: 13px;
}
.el-menu-vertical-demo.beautify-menu .el-menu--inline .el-sub-menu__title {
  padding-left: 28px !important;
  font-size: 14px;
}
.el-menu-vertical-demo.beautify-menu .el-menu--inline .el-menu--inline .el-sub-menu__title {
  padding-left: 46px !important;
  font-size: 13px;
}
</style>